package eleven.test_11_21;

import java.util.Scanner;

public class TestMain1 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int a = scanner.nextInt();
        int b = scanner.nextInt();
        int max = Integer.MIN_VALUE;
        for (int i = 0; i <= b; i++) {
            max = Math.max(a ^ i, max);
        }
        System.out.println(max);
    }
}
